<!--sidebar-menu-->
<div id="sidebar" class="clearfix"><!-- <a href="#" class="visible-phone"><i class="icon icon-home"></i> Dashboard</a> -->
  <ul style="display: block;">
  {% include "common/menu.html" %}
  </ul>
</div>
<!--end sidebar-menu-->

<div id="content">
  
    <div class="container-fluid" style="padding: 0;">
      <div class="widget-box tab-tabs" >
          <div class="widget-title">
            <ul class="nav nav-tabs">
              <li class="active"><a data-toggle="tab" href="#tab1">机器人</a></li>
              <li><a data-toggle="tab" href="#tab2">自动跳转</a></li>
            </ul>
          </div>
          <div class="widget-content tab-content">
            <div id="tab1" class="tab-pane active">
              <div class="container-fluid">
                <div class="row-fluid" style="margin: 20px 0 ;overflow: hidden;">
                    <form id="signingSearch" class="form-search">
                        <input id="isFamily" type="hidden" >
                        <span style="font-size:20px; line-height: 30px">配置给正在直播的房间加机器人的规则</span>
                        <span class="find-search pull-right">
                        <button  type="button" class="btn btn-purple" onclick="addroomDialog()">添加规则</button>
                        </span>
                    </form>
                </div>

                <div class="row-fluid">
                    <table id="tableListRobotConfig" class="table with-check table-purple">
                        <thead>
                        <tr>
                            <th>条件</th>
                            <th>规则</th>
                            <th></th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>
                                <span>用户数 ＜ 500人</span>
                            </td>
                            <td><span class="font font18 cr-ly">1代N，1个用户增加5个机器人</span></td>
                            <td><span class="spanedit"><a>修改</a>&nbsp;|&nbsp;<a onclick="delroomDialog()"> 删除</a></span></td>
                        </tr>

                        <tr>
                            <td>
                                <span>用户数 ＜ 500人</span>
                            </td>
                            <td><span class="font font18 cr-ly">直接增加，每1分钟加50个机器人</span></td>
                            <td><span class="spanedit"><a>修改</a>&nbsp;|&nbsp;<a onclick="delroomDialog()"> 删除</a></span></td>
                        </tr>

                        </tbody>
                    </table>
                </div>

                <div class="row-fluid">
                    <div class="total pull-left">
                        <p class="font font18 cr-gy">
                            <span>记录总数：</span>
                            <span id="robotConfigCount" >0</span>
                        </p>
                    </div>
                    <div id="pagination" class="pagination alternate pull-right">

                    </div>
                </div>
            </div>
                <div class="container-fluid">
                    <div class="row-fluid" style="margin: 20px 0 ;overflow: hidden;">
                        <form id= class="form-search">
                            <input  type="hidden" >
                            <span style="font-size:20px; line-height: 30px">配置结束的直播的房间，机器人退出的规则，按顺序执行</span>
                            <span class="find-search pull-right">
                  <button  type="button" class="btn btn-purple" onclick="endaddDialog()">添加规则</button>
                  </span>
                        </form>
                    </div>

                    <div class="row-fluid">
                        <table id="tableListRobotOutConfig"  class="table with-check table-purple">
                            <thead>
                            <tr>
                                <th style="width: 800px;">规则</th>
                                <th></th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>
                                    <span>等待3秒</span>
                                </td>

                                <td><span class="spanedit"><a>修改</a>&nbsp;|&nbsp;<a> 删除</a>&nbsp;|&nbsp;<a> 上移</a>&nbsp;|&nbsp;<a> 下移</a></span></td>
                            </tr>

                            <tr>
                                <td>
                                    <span>直接减少，减少50%机器人</span>
                                </td>
                                <td><span class="spanedit"><a>修改</a>&nbsp;|&nbsp;<a> 删除</a>&nbsp;|&nbsp;<a> 上移</a>&nbsp;|&nbsp;<a> 下移</a></span></td>
                            </tr>

                            </tbody>
                        </table>
                    </div>

                    <div class="row-fluid">
                        <div class="total pull-left">
                            <p class="font font18 cr-gy">
                                <span>记录总数：</span>
                                <span id="robotConfigOutCount">0</span>
                            </p>
                        </div>
                        <div id="paginationrobotConfigOut" class="pagination alternate pull-right">

                        </div>
                    </div>
                </div>
            </div>
            <div id="tab2" class="tab-pane"> 
              <div class="container-fluid">
                  <div class="row-fluid" style="margin: 20px 0 ;overflow: hidden;">
                      <form  class="form-search">
                          <input id="isFamily" type="hidden" >
                          <span style="font-size:20px; line-height: 30px">配置直播结束时，自动跳转的主播房间；系统将在下列正在直播的房间中随机跳转。</span>
                        <span class="find-search pull-right">
                        <button  type="button" class="btn btn-purple">添加主播</button>
                        </span>
                      </form>
                  </div>
                
               <div>
                   <ul>
                       <li style="list-style: none;">
                           <div style="width: 250px;height: 200px;border: 1px solid #cccccc;border-bottom: 2px solid #817CCE">
                               <div style="height: 150px;position: relative;">
                                   <img src="{{static_url('web/img/91ns/u75.jpg')}}">
                                   <span style="width: 36px;height: 62px;margin-top: -150px;font-size: 16px;color: #ffffff;text-align: center; position: absolute;background:url(../web/img/91ns/u126.png) ">
                                       <p style="margin-top: 7px;">直<br/>播</p>
                                   </span>
                               </div>
                               <div class="clearfix">
                                   <div style="width: 180px;height: 50px;font-size: 14px;margin-left: 15px;float: left;">
                                      <span style="width: 180px; display: inline-block;margin-top: 3px;">气压表上打</span>
                                      <span style="width: 180px;display: inline-block;margin-top: 3px;">uid:12134545</span>
                                   </div>
                                   <div style="width: 50px;float: left;font-size: 14px;height: 50px;line-height: 70px;margin-left: 5px;text-align: center;">
                                       <span><a>删除</a></span>
                                   </div>
                               </div>
                           </div>
                       </li>
                   </ul>
               </div>
                

              </div>
            </div>
            
         </div>
        </div>
    
    </div>

</div>
<div id="addroomDialog" style="display:none"> <!--class="ui-dialog"-->
    <form id="roomruleDialogForm">
        <div>
            <span>满足以下</span>
            <select name="conditions" style="width: 110px;">
                <option value="2">全部且</option>
                <option value="1">任意或</option>
            </select>
            <span>条件</span>
            <button id="btnConditions" type="button" class="btn btn-purple" style="height: 30px;">添加条件</button>
        </div>
        <div style="height: 210px;width: 665px;border-radius: 4px;background-color: #f9f9f9;margin: 10px auto 30px;border: 1px solid #cccccc;overflow:auto;">
            <div id="roomconditionsclone" style="display:none;">
                <div class="roomconditions-box" style="height: 40px;line-height: 40px;border-bottom: 1px dashed #cccccc;">
                    <span style="margin-left: 40px;">用户数</span>
                    <select name="conditionsValue" class="selconditions" style="width: 110px;margin-top: 5px;margin-left: 40px;">
                        
                    </select>
                    <input name="level" class="inputlevel" type="text" style="width: 180px;margin: -5px 0 0 10px;"><span style="margin-left: 10px;">人</span>
                    <div class="font font20" style="cursor: pointer; color: red; width: 22px;height: 22px;margin:0 0 -4px 10px;display: inline-block;"><span class="icon-minus-sign" onclick="removeCondbox(this)"></span></div>
                </div>
            </div>
            <div id="roomconditionsclone2">

            </div>

        </div>
        <div><span>请匹配规则：</span></div>
        <div style="width: 660px;margin-left: 15px;">
            <div>
                <select id="select_id">
                    <option value="1">1代N</option>
                    <option value="2">直接增加</option>
                </select>
            </div>
            <div id="noDirect" style="display: block">
               <input name="dir_user_add" type="text">
                <span>个用户增加</span>
                <input name="dir_user_robot" type="text">
                <span>个机器人</span>
            </div>
            <div id="Direct" style="display: none">
                <span>每</span>
                <input name="dir_co_value" type="text">
                <span>分钟增加</span>
                <input name="dir_user_robot2" type="text">
                <span>个机器人</span>
            </div>

        </div>
    </form>
</div>
<div id="delroomDialog" style="display:none">
    <div style="height: 115px;line-height: 115px;text-align: center;font-size: 16px;">确定删除这条规则？</div>
</div>
<div id="endaddDialog" style="display:none">
    <form id="endaddDialogForm">
        <div style="margin-top:20px;font-size: 16px;"><span>请匹配规则：</span></div>
        <div style="margin-top: 20px">
            <select id="endselect_id" style="width: 200px;">
                <option value="1">等待时间</option>
                <option value="2">直接减少</option>
                <option value="3">按比例减少</option>
            </select>
        </div>
        <div id="waittime" class="endaddvalue" style="display: block;margin-top: 20px">
            <input name="wat_value" type="text" style="width: 175px;">
            <span>秒</span>
        </div>
        <div id="Directdel" class="endaddvalue" style="display:none;margin-top: 20px">
            <span>减少</span>
            <input name="dir_value" type="text" style="width: 175px;">
            <span>%机器人</span>
        </div>
        <div id="noDirectdel" class="endaddvalue" style="display:none;margin-top: 20px">
            <span>每</span>
            <input name="nodir_value" type="text" style="width: 175px;">
            <span>分钟减少</span>
            <input name="nodir_value2" type="text" style="width: 175px;">
            <span>%</span>
        </div>
    </form>

</div>

<script type="text/javascript" src="{{static_url('web/js/jquery.range.js')}}"></script>
<script type="text/javascript" src="{{static_url('web/js/91ns.room.js')}}"></script>
<link rel="stylesheet" href="{{static_url('web/css/jquery.range.css')}}">
<script type="text/javascript">

  $(function(){

    getRobotConfigList();
    getSymbol();

    getRobotOutConfigList();

    selectchange();
    endselectchange();
  });


  function selectchange(){
        $('#select_id').change(function(){
            var checkValue=$("#select_id").val()
            if(checkValue==0){
                $('#Direct').hide();
                $('#noDirect').show();
            }
            else{
                $('#noDirect').hide();
                $('#Direct').show();
            }
        })
    }

  //  机器人删除规则
  function delroomDialog(){

      $('#delroomDialog').dialog({
          autoOpen:true,
          width:440,
          height:250,
          title:'删除确认',
          resizable:false,
          modal:true,
          open:function(){
              getExcAnchor();
          },
          buttons: {
              "确定": function () {


              },
              "取消": function () {


              }
          }
      });
  }

  
  
</script>